/******************************************************************************
*
*               Copyright Mentor Graphics Corporation 2003
*                           All rights reserved
*
*   THIS WORK CONTAINS TRADE SECRETS AND PROPRIETARY INFORMATION WHICH IS
*    THE PROPERTY OF MENTOR GRAPHICS CORPORATION OR ITS LICENSORS AND IS
*                        SUBJECT TO LICENSE TERMS
*
*******************************************************************************

*******************************************************************************
* FILE NAME                                                          VERSION
* act_enum_test.c                                                      1.1
*
* COMPONENT
* ANSI/ISO C test application
*
* DESCRIPTION
* Demonstrates the use of ENUM
*
* DATA STRUCTURES
* enum NAME_BEFORE_ENUM
* enum ENUM_WITHOUT_ASSIGNMENT
* enum ENUM_WITH_ASSIGNMENT
*
* FUNCTIONS
* int act_enum_test(int value)
*
* DEPENDENCIES
* act_test.h
******************************************************************************/

#include "act_test.h"

#if (ACT_ENUM_TEST)

/******************************************************************************
 *
 *   Create three ENUM types
 * 1. Assigned values with ENUM name following definition
 * 2. Unassigned values
 * 3. Assigned values
 *
******************************************************************************/
typedef enum 
{
     EWOA_0,
     EWOA_1,
     EWOA_2
} ENUM_WITHOUT_ASSIGNMENT;

typedef enum 
{	
     EWA_0 = 0,
     EWA_1,
     EWA_2,
     EWA_3,
	
     EWA_6 = 6,
     EWA_7,
     EWA_8
} ENUM_WITH_ASSIGNMENT;


ENUM_WITHOUT_ASSIGNMENT g_ewoa1 = EWOA_2;
ENUM_WITH_ASSIGNMENT g_ewa1 = EWA_3;

/******************************************************************************
* FUNCTION
* int act_enum_test(int value)
*
* DESCRIPTION
* Demonstrates how ENUM value access works with different types of 
* ENUM definitions
*
* INPUTS
* int value
*
* OUTPUTS
* int
******************************************************************************/
int act_enum_test(int value)
{
     ENUM_WITHOUT_ASSIGNMENT ewoa1,ewoa2;
     ENUM_WITH_ASSIGNMENT	ewa1 = EWA_3;

	
     ewoa1	= EWOA_0;
     g_ewoa1 = ewoa1;
     ewoa1	= EWOA_1;
     ewoa2	= EWOA_2;

     if ((g_ewoa1 == ewoa2) && (g_ewa1 == ewa1))
          return 1;
     else
          return 0;

	
}

#endif
